package com.tubi.xmlpaese;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import javax.swing.text.DefaultStyledDocument;
import java.io.File;
import java.util.List;

public class XmlParse {
    public static void main(String[] args) throws DocumentException {

        SAXReader saxReader = new SAXReader();

        Document document = saxReader.read(new File("test-myxml/xml/myxml.xml"));
        //3.获取到根标签
        Element rootElement = document.getRootElement();
        List list = rootElement.elements();
        System.out.println(list.size());

    }
}
